import Vue from 'vue'
import App from './App'
import uView from "uview-ui";

import request from 'api/http.js'
import {
	api_version
} from 'api/api.js'
Vue.config.productionTip = false

import store from '@/store/index.js'

Vue.prototype.$store = store
Vue.prototype.$http = request
Vue.prototype.$api = api_version

Vue.prototype.$tourl = (url) => {
	if (!url) return
	if (!uni.getStorageSync('token')) {
		uni.navigateTo({
			url: '/pages/login/login'
		})
		return
	}
	uni.navigateTo({
		url: url,
		fail() {
			uni.switchTab({
				url: url
			})
		}
	})
}
App.mpType = 'app'

Vue.use(uView);
const app = new Vue({
	...App,
	//挂载
	store
})
app.$mount()
